import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import postCssPxToViewPort from "postcss-px-to-viewport";
// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  css: {
    postcss: {
      plugins: [
        postCssPxToViewPort({
          viewportWidth: 1680, // 设计稿宽度
          unitToConvert: "px", // 转换的单位
          viewportUnit: "vw", // 转换后的单位
          selectorBlackList: [".ignore", ".no-vw"], // 忽略的类名
          exclude: [/node_modules/, /ignore-folder/], // 忽略的文件或目录
          minPixelValue: 1, // 小于等于1px不转换
        }),
      ],
    },
  },
});
